package com.muyu.danmo.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.common.core.annotation.Excel;
import com.muyu.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * 社区对象 danmo_community
 *
 * @author : kunzong
 * @date : 2024-11-19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DanmoCommunity extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 帖子唯一标识
     */
    @Excel(name = "帖子唯一标识")
    private Long id;

    /**
     * 用户名称
     */
    private String name;

    /**
     * 用户id
     */
    private Long userId;

    private String followThisUser;

    /**
     * 帖子内容
     */
    @Excel(name = "帖子内容")
    private String content;

    /**
     * 发帖用户id
     */
    @Excel(name = "发帖用户id")
    private Long authorId;

    /**
     * 创建人
     */
    @Excel(name = "创建人")
    private String createBy;

    /**
     * 创建时间
     */
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 更新人
     */
    @Excel(name = "更新人")
    private String updateBy;

    /**
     * 更新时间
     */
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 距今时间
     */
    @Excel(name = "距今时间")
    private String timeAgo;

    /**
     * 帖子浏览量
     */
    @Excel(name = "帖子浏览量")
    private Long views;

    /**
     * 帖子点赞数
     */
    @Excel(name = "帖子点赞数")
    private Long likes;

    /**
     * 帖子评论数
     */
    @Excel(name = "帖子评论数")
    private Long comments;

    /**
     * 帖子收藏数
     */
    @Excel(name = "帖子收藏数")
    private Long collects;

    /**
     * 用户头像
     */
    @Excel(name = "用户头像")
    private String picture;

    /**
     * 本人头像
     */
    @Excel(name = "本人头像")
    private String myPicture;

    /**
     * 用户所在省份
     */
    @Excel(name = "用户所在省份")
    private String province;

    /**
     * 是否收藏
     */
    private String favoriteName;

    /**
     * 是否点赞
     */
    private String likeName;

    /**
     * 是否隐藏
     */
    private String whetherToHide;

    /**
     * 起止时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "CST")
    private Date startTime;

    /**
     * 终止时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "CST")
    private Date endTime;

    /**
     * 是否为本人
     */
    private String isMine;

    /**
     * 社区照片
     */
    private List<DanmoCommunityPicture> danmoCommunityPictureList;

    /**
     * 社区收藏
     */
    private List<DanmoCommunityFavorite> danmoCommunityFavoriteList;

    /**
     * 社区评论
     */
    private List<DanmoCommunityComment> danmoCommunityCommentList;

    /**
     * 社区点赞
     */
    private List<DanmoCommunityLike> danmoCommunityLikeList;

    /**
     * 关注关系
     */
    private List<DanmoUserFollows> danmoUserFollowsList;


    private Integer pageNum = 1;
    private Integer pageSize = 10;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("content", getContent())
                .append("authorId", getAuthorId())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("views", getViews())
                .append("myPicture", getMyPicture())
                .toString();
    }
}